package com.example.base_kotlin_xml.view

import androidx.lifecycle.lifecycleScope
import com.blankj.utilcode.util.ToastUtils
import com.example.base_kotlin_xml.R
import com.example.base_kotlin_xml.databinding.FragmentMultiViewClickBinding
import com.example.base_model.utils.MultiViewDebounceManager
import com.example.base_model.view.BaseFragment
import dagger.hilt.android.AndroidEntryPoint

/**
 * @Author: jiangKunKun
 * @CreateDate: 2025/8/25
 * @Description: 多个View点击事件
 * @SpittingGrooves
 */
@AndroidEntryPoint
class MultiViewClickFragment : BaseFragment<FragmentMultiViewClickBinding>() {
    private lateinit var oneEventType: MultiViewDebounceManager
    private lateinit var twoEventType: MultiViewDebounceManager

    override fun initObservers() {

    }

    override fun initClickEvents() {
        oneEventType = MultiViewDebounceManager(
            delayMillis = 1000,
            views = setOf(mBinding.btnType1, mBinding.btnType2, mBinding.btnType3),
            scope = lifecycleScope,
            action = {
                ToastUtils.showShort("执行点击事件\n类型一")
            }
        )
        twoEventType = MultiViewDebounceManager(
            delayMillis = 1000,
            views = setOf(mBinding.btnType4, mBinding.btnType5),
            scope = lifecycleScope,
            action = {
                ToastUtils.showShort("执行点击事件\n类型二")
            }
        )
    }

    override fun initData() {

    }

    override fun attachLayoutRes(): Int = R.layout.fragment_multi_view_click

}